/*
 * crash_oscillogram_packet.cpp
 *
 *  Created on: 20.07.2013
 *      Author: SpirTanol
 */

#include "packets/crash_oscillogram_packet.h"

CrashOscillogramPacket::CrashOscillogramPacket()
{
	init();
}

CrashOscillogramPacket::CrashOscillogramPacket(const CrashOscillogramPacket *packet)
{
	init();

	memcpy(oData, packet->oData, sizeof(ushort) * R_SIZE);
}

void CrashOscillogramPacket::init()
{
	addPart(Part(&oData[R_TIME], 5, 301));

	addPart(Part(&oData[R_CUR_PHASE_A], 64, 306));
	addPart(Part(&oData[R_CUR_PHASE_B], 64, 370));
	addPart(Part(&oData[R_CUR_PHASE_C], 64, 434));

	addPart(Part(&oData[R_VOL_PHASE_A], 64, 498));
	addPart(Part(&oData[R_VOL_PHASE_B], 64, 562));
	addPart(Part(&oData[R_VOL_PHASE_C], 64, 626));
}
